#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int Sn(int x)
{
	int i = 0;
	int num = 0;
	int sum = 0;

	for (i = 0; i < 5; i++)
	{
		num = num * 10 + x;
		sum = sum + num;
	}
	return sum;
}

int main()
{
	int a = 0;
	scanf("%d", &a);

	printf("%d", Sn(a));
	return 0;
}